
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>Component state · React 基础学习资料</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="小翼">
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="02.html" />
    
    
    <link rel="prev" href="00.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    React 手稿
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../chapter01/00.html">
            
                <a href="../chapter01/00.html">
            
                    
                    基础知识
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../chapter01/01.html">
            
                <a href="../chapter01/01.html">
            
                    
                    初识React
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="../chapter01/02.html">
            
                <a href="../chapter01/02.html">
            
                    
                    React 特性
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="../chapter01/03.html">
            
                <a href="../chapter01/03.html">
            
                    
                    React Initial Project
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4" data-path="../chapter01/04.html">
            
                <a href="../chapter01/04.html">
            
                    
                    Component和Dom
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.5" data-path="../chapter01/05.html">
            
                <a href="../chapter01/05.html">
            
                    
                    生态组件
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../chapter02/00.html">
            
                <a href="../chapter02/00.html">
            
                    
                    组件生命周期
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../chapter02/01.html">
            
                <a href="../chapter02/01.html">
            
                    
                    装载
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../chapter02/02.html">
            
                <a href="../chapter02/02.html">
            
                    
                    更新
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="../chapter02/03.html">
            
                <a href="../chapter02/03.html">
            
                    
                    卸载
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.4" data-path="../chapter02/04.html">
            
                <a href="../chapter02/04.html">
            
                    
                    异常处理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.5" data-path="../chapter02/05.html">
            
                <a href="../chapter02/05.html">
            
                    
                    React.Component
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="00.html">
            
                <a href="00.html">
            
                    
                    state
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter active" data-level="1.4.1" data-path="01.html">
            
                <a href="01.html">
            
                    
                    Component state
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="02.html">
            
                <a href="02.html">
            
                    
                    React-Redux
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="03.html">
            
                <a href="03.html">
            
                    
                    React-Router
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="04.html">
            
                <a href="04.html">
            
                    
                    redux-saga
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../chapter04/00.html">
            
                <a href="../chapter04/00.html">
            
                    
                    组件其他方法
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../chapter04/01.html">
            
                <a href="../chapter04/01.html">
            
                    
                    其他API
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="../chapter04/02.html">
            
                <a href="../chapter04/02.html">
            
                    
                    类属性
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="../chapter04/03.html">
            
                <a href="../chapter04/03.html">
            
                    
                    实例属性
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../chapter05/00.html">
            
                <a href="../chapter05/00.html">
            
                    
                    React 高级用法
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../chapter05/01.html">
            
                <a href="../chapter05/01.html">
            
                    
                    keys
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../chapter05/02.html">
            
                <a href="../chapter05/02.html">
            
                    
                    事件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="../chapter05/03.html">
            
                <a href="../chapter05/03.html">
            
                    
                    Refs
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.4" data-path="../chapter05/04.html">
            
                <a href="../chapter05/04.html">
            
                    
                    Fragment
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.5" data-path="../chapter05/05.html">
            
                <a href="../chapter05/05.html">
            
                    
                    Context
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.6" data-path="../chapter05/06.html">
            
                <a href="../chapter05/06.html">
            
                    
                    高阶组件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.7" data-path="../chapter05/07.html">
            
                <a href="../chapter05/07.html">
            
                    
                    类型查检
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.8" data-path="../chapter05/08.html">
            
                <a href="../chapter05/08.html">
            
                    
                    代码分隔
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../chapter06/00.html">
            
                <a href="../chapter06/00.html">
            
                    
                    React 实例
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../chapter06/01.html">
            
                <a href="../chapter06/01.html">
            
                    
                    List
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="../chapter06/02.html">
            
                <a href="../chapter06/02.html">
            
                    
                    Form
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3" data-path="../chapter06/03.html">
            
                <a href="../chapter06/03.html">
            
                    
                    Form高级
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.4" data-path="../chapter06/04.html">
            
                <a href="../chapter06/04.html">
            
                    
                    Tooltip
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="../chapter07/00.html">
            
                <a href="../chapter07/00.html">
            
                    
                    React项目打包部署
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.1" data-path="../chapter07/01.html">
            
                <a href="../chapter07/01.html">
            
                    
                    与服务端交互
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.2" data-path="../chapter07/02.html">
            
                <a href="../chapter07/02.html">
            
                    
                    打包
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3" data-path="../chapter07/03.html">
            
                <a href="../chapter07/03.html">
            
                    
                    部署
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="../chapter08/00.html">
            
                <a href="../chapter08/00.html">
            
                    
                    浅谈ES
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.1" data-path="../chapter08/01.html">
            
                <a href="../chapter08/01.html">
            
                    
                    ES6 (ES2015)
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.2" data-path="../chapter08/02.html">
            
                <a href="../chapter08/02.html">
            
                    
                    ES7 (ES2016)
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.3" data-path="../chapter08/03.html">
            
                <a href="../chapter08/03.html">
            
                    
                    ES8 (ES2017)
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4" data-path="../chapter08/04.html">
            
                <a href="../chapter08/04.html">
            
                    
                    ES9 (ES2018)
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="../chapter09/00.html">
            
                <a href="../chapter09/00.html">
            
                    
                    React Hooks
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.10.1" data-path="../chapter09/01.html">
            
                <a href="../chapter09/01.html">
            
                    
                    State Hooks useState
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.2" data-path="../chapter09/02.html">
            
                <a href="../chapter09/02.html">
            
                    
                    State Hooks useReducer
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >Component state</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="component-state">Component state</h1>
<p>&#x5B9E;&#x4F8B;&#xFF1A;</p>
<pre><code class="lang-jsx"><span class="hljs-keyword">import</span> React, { PureComponent } <span class="hljs-keyword">from</span> <span class="hljs-string">&apos;react&apos;</span>;

<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">PureComponent</span> </span>{
  <span class="hljs-keyword">constructor</span>(props) {
    <span class="hljs-keyword">super</span>(props);
    <span class="hljs-keyword">this</span>.state = { time: <span class="hljs-string">&apos;&apos;</span> };
  }

  componentDidMount() {
    setInterval(() =&gt; {
      <span class="hljs-keyword">const</span> now = <span class="hljs-keyword">new</span> <span class="hljs-built_in">Date</span>();
      <span class="hljs-keyword">let</span> { time } = <span class="hljs-keyword">this</span>.state;
      <span class="hljs-keyword">const</span> year = now.getFullYear();
      <span class="hljs-keyword">const</span> month = now.getMonth() + <span class="hljs-number">1</span>;
      <span class="hljs-keyword">const</span> day = now.getDate();
      <span class="hljs-keyword">const</span> hours = now.getHours();
      <span class="hljs-keyword">const</span> minutes = now.getMinutes();
      <span class="hljs-keyword">const</span> seconde = now.getSeconds();
      time = <span class="hljs-string">`<span class="hljs-subst">${`0000${year}</span>`</span>.slice(<span class="hljs-number">-4</span>)}-${<span class="hljs-string">`00<span class="hljs-subst">${month}</span>`</span>.slice(<span class="hljs-number">-2</span>)}-${<span class="hljs-string">`00<span class="hljs-subst">${day}</span>`</span>.slice(<span class="hljs-number">-2</span>)} ${<span class="hljs-string">`00<span class="hljs-subst">${hours}</span>`</span>.slice(<span class="hljs-number">-2</span>)}:${<span class="hljs-string">`00<span class="hljs-subst">${minutes}</span>`</span>.slice(<span class="hljs-number">-2</span>)}:${<span class="hljs-string">`00<span class="hljs-subst">${seconde}</span>`</span>.slice(<span class="hljs-number">-2</span>)}<span class="hljs-string">`
      this.setState({ time });
    }, 1000);
  }

  render() {
    return (
      &lt;div&gt;{this.state.time}&lt;/div&gt;
    )
  }
}
</span></code></pre>
<p><a href="https://codesandbox.io/s/o551j5lmry" target="_blank">Timer &#x5728;&#x7EBF;&#x5B9E;&#x4F8B;</a></p>
<h2 id="&#x5B9A;&#x4E49;">&#x5B9A;&#x4E49;</h2>
<p>  &#x5199;&#x5728;<code>constructor</code>&#x51FD;&#x6570;&#x4E2D;&#xFF0C;&#x662F;&#x4E00;&#x4E2A;<code>Object</code>&#x5BF9;&#x8C61;&#x3002;&#x4E00;&#x822C;&#x60C5;&#x51B5;&#x4E0B;&#x9700;&#x8981;&#x6307;&#x5B9A;&#x9ED8;&#x8BA4;&#x503C;&#xFF0C;&#x9884;&#x9632;&#x629B;<code>undefined</code>.</p>
<h2 id="&#x4F7F;&#x7528;">&#x4F7F;&#x7528;</h2>
<p>  &#x5728;&#x7EC4;&#x4EF6;&#x4E2D;&#x901A;&#x8FC7;&#x8BBF;&#x95EE;&#x7EC4;&#x4EF6;&#x5BF9;&#x8C61;&#x5C5E;&#x6027;&#x7684;&#x65B9;&#x5F0F;&#x3002;&#x76F4;&#x63A5;&#x83B7;&#x53D6;&#xFF1A;<code>this.state.time</code>.
  &#x6211;&#x4EEC;&#x901A;&#x5E38;&#x4F1A;&#x5148;&#x83B7;&#x53D6;<code>state</code>&#x6570;&#x636E;&#xFF0C;&#x518D;&#x6E32;&#x7136;&#x5230;&#x9875;&#x9762;&#xFF0C;&#x4F8B;&#x5982;&#xFF1A;</p>
<pre><code class="lang-jsx">    render() {
      <span class="hljs-keyword">const</span> {time} = <span class="hljs-keyword">this</span>.state;
      <span class="hljs-keyword">return</span> (
        <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>{time}<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span></span>
      );
    }
</code></pre>
<h2 id="setstate">setState</h2>
<p>  &#x5148;&#x770B;&#x4E00;&#x6BB5;&#x4EE3;&#x7801;&#xFF1A;</p>
<pre><code class="lang-jsx"><span class="hljs-keyword">import</span> React, {PureComponent} <span class="hljs-keyword">from</span> <span class="hljs-string">&apos;react&apos;</span>;

<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">PureComponent</span> </span>{
  <span class="hljs-keyword">constructor</span>(props) {
    <span class="hljs-keyword">super</span>(props);
    <span class="hljs-keyword">this</span>.state = {name: <span class="hljs-string">&apos;world&apos;</span>};
  }

  render() {
    <span class="hljs-keyword">const</span> {name} = <span class="hljs-keyword">this</span>.state;
    <span class="hljs-keyword">return</span> (
      <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">input</span> <span class="hljs-attr">defaultValue</span>=<span class="hljs-string">{name}</span> <span class="hljs-attr">name</span>=<span class="hljs-string">&quot;name&quot;</span> /&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>Holle, {name}!<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
      <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
    );
  }
}
</span></code></pre>
<ul>
<li><p>&#x6570;&#x636E;&#x5355;&#x548C;&#x5411;&#x6027;</p>
<p> <code>input</code>&#x4E0E;<code>div</code>&#x4E2D;&#x76F4;&#x63A5;&#x663E;&#x793A;<code>name</code>&#x7684;&#x5185;&#x5BB9;,&#x4F46;&#x662F;&#xFF0C;&#x5728;<code>input</code>&#x4E2D;&#x76F4;&#x63A5;&#x8F93;&#x5165;&#x5185;&#x5BB9;&#xFF0C;<code>div</code>&#x7684;&#x663E;&#x793A;&#x4E0D;&#x4F1A;&#x6539;&#x53D8;&#x3002;</p>
<blockquote>
<p>&#x628A;&#x8FD9;&#x79CD;&#x7EC4;&#x4EF6;&#x4E5F;&#x79F0;&#x4E3A;&#x975E;&#x53D7;&#x63A7;&#x6027;&#x7EC4;&#x4EF6;&#x3002;</p>
</blockquote>
</li>
<li><p>setState</p>
<p>&#x901A;&#x8FC7;React&#x63D0;&#x4F9B;&#x4E86;<code>setState</code>&#x65B9;&#x6CD5;&#xFF0C;&#x6765;&#x5B9E;&#x73B0;<code>state</code>&#x7684;&#x4FEE;&#x6539;&#x3002;</p>
<p>&#x6211;&#x4EEC;&#x53EA;&#x8981;&#x5C06;&#x4E0A;&#x8FF0;&#x7684;&#x975E;&#x53D7;&#x63A7;&#x6027;&#x7EC4;&#x4EF6;&#x4FEE;&#x6539;&#x4E3A;&#x53D7;&#x63A7;&#x6027;&#x7EC4;&#x4EF6;&#x5373;&#x53EF;&#xFF0C;&#x5982;&#x4E0B;&#xFF1A;</p>
<pre><code class="lang-jsx"> &lt;input value={name} onChange={e =&gt; <span class="hljs-keyword">this</span>.setState({name: e.target.value})} /&gt;
</code></pre>
<p>&#x4F7F;&#x7528;<code>setState</code>&#x65B9;&#x6CD5;&#x9700;&#x8981;&#x6CE8;&#x610F;&#x4EE5;&#x4E0B;&#x51E0;&#x70B9;&#xFF1A;</p>
<ul>
<li><p>&#x5F02;&#x6B65;</p>
<pre><code class="lang-jsx">onChange () {
<span class="hljs-keyword">this</span>.setState({name: <span class="hljs-string">&apos;hasChanged&apos;</span>})
<span class="hljs-built_in">console</span>.log(<span class="hljs-keyword">this</span>.state.name === <span class="hljs-string">&apos;hasChanged&apos;</span>); <span class="hljs-comment">//false</span>
}
</code></pre>
</li>
<li><p>&#x5408;&#x5E76;</p>
<pre><code class="lang-jsx"><span class="hljs-keyword">this</span>.state = {name: <span class="hljs-string">&apos;xiaoshouyi&apos;</span>, address: <span class="hljs-string">&apos;beijing&apos;</span>};

<span class="hljs-keyword">this</span>.setState({address: <span class="hljs-string">&apos;xi an&apos;</span>});

<span class="hljs-comment">//not</span>
<span class="hljs-comment">//this.setState({...this.state, addree: &apos;xi an&apos;});</span>
<span class="hljs-comment">//&#x4F46;&#x662F;&#x8FD9;&#x79CD;&#x65B9;&#x5F0F;&#x5728;&#x5BF9;&#x8C61;&#x4FEE;&#x6539;&#x7684;&#x65F6;&#x5019;&#x975E;&#x5E38;&#x6709;&#x7528;&#x3002;</span>

<span class="hljs-built_in">console</span>.log(<span class="hljs-keyword">this</span>.state) <span class="hljs-comment">//{name: &apos;xiaoshouyi&apos;, address: &apos;xi an&apos;}</span>
</code></pre>
<p>&#x7C7B;&#x4F3C;&#x4E0E;<code>Object.assgin()</code>&#x3002;</p>
</li>
<li><p>&#x56DE;&#x8C03;</p>
<pre><code class="lang-jsx"><span class="hljs-keyword">this</span>.setState({name: <span class="hljs-string">&apos;changed&apos;</span>}, () =&gt; {
<span class="hljs-built_in">console</span>.log(<span class="hljs-keyword">this</span>.state.name); <span class="hljs-comment">// changed</span>
});
</code></pre>
</li>
</ul>
</li>
</ul>
<p><a href="https://codesandbox.io/s/0y658350z0" target="_blank">&#x975E;&#x63A7;&#x7EC4;&#x4EF6; &#x5728;&#x7EBF;&#x5B9E;&#x4F8B;</a></p>
<p><a href="https://codesandbox.io/s/3yjkno9o3q" target="_blank">&#x53D7;&#x63A7;&#x7EC4;&#x4EF6; &#x5728;&#x7EBF;&#x5B9E;&#x4F8B;</a></p>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="00.html" class="navigation navigation-prev " aria-label="Previous page: state">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="02.html" class="navigation navigation-next " aria-label="Next page: React-Redux">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"Component state","level":"1.4.1","depth":2,"next":{"title":"React-Redux","level":"1.4.2","depth":2,"path":"chapter03/02.md","ref":"./chapter03/02.md","articles":[]},"previous":{"title":"state","level":"1.4","depth":1,"path":"chapter03/00.md","ref":"./chapter03/00.md","articles":[{"title":"Component state","level":"1.4.1","depth":2,"path":"chapter03/01.md","ref":"./chapter03/01.md","articles":[]},{"title":"React-Redux","level":"1.4.2","depth":2,"path":"chapter03/02.md","ref":"./chapter03/02.md","articles":[]},{"title":"React-Router","level":"1.4.3","depth":2,"path":"chapter03/03.md","ref":"./chapter03/03.md","articles":[]},{"title":"redux-saga","level":"1.4.4","depth":2,"path":"chapter03/04.md","ref":"./chapter03/04.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":[],"root":"./books","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"小翼","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"React 基础学习资料","language":"zh-hans","links":{"gitbook":false,"sharing":{"google":true,"facebook":true,"twitter":true}},"gitbook":"*"},"file":{"path":"chapter03/01.md","mtime":"2020-03-07T07:33:43.854Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2020-03-09T08:08:41.080Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

